package com.xuebank.nfe.nfecar.adapter

import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.LayoutHelper
import com.xuebank.nfe.nfecar.model.ListShop

/**
 * Created by Wind_Fantasy on 2017/3/30.
 */
abstract class BaseVirtualLayoutAdapter<T, VH : BaseRecyclerViewHolder>
(var mDatas: MutableList<ListShop>, var layoutHelper: LayoutHelper, var onItemClickListener: OnItemClickListener? = null) : DelegateAdapter.Adapter<VH>() {

    override fun getItemCount(): Int {
        return mDatas.count()
    }


    override fun onCreateLayoutHelper(): LayoutHelper {
        return layoutHelper
    }

    override fun onBindViewHolder(holder: VH, position: Int) {
        if (!holder.isHadItemClickListener) {
            holder.setOnItemClickListener(onItemClickListener)
        }
    }

}